@extends('layouts.app')
@section('content')
    <div class="page-content">
        <div class="content">
            <!-- 右侧内容框架，更改从这里开始 -->
            <br>
            <form class="well form-search" method="post">
                发布时间<input type="text" name="start_time" class="js-date" value="" style="width: 80px;" autocomplete="off">-
                <input autocomplete="off" type="text" class="js-date" name="end_time" value="" style="width: 80px;"> 关键字			<input type="text" name="keyword" style="width: 200px;" value="" placeholder="请输入关键字...">
                <button class="btn btn-primary">搜索</button>
            </form>
            <br><br>

            <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span1">用户</span>
            <span class="btn btn-warning pull-right" lay-submit lay-filter="login" id="span2">添加</span>

            <br><br>
            <button class="btn btn-primary btn-small js-ajax-submit" type="submit"  id="px">排序</button>
            <div id="d1">
            <table class="layui-table">
                <thead>
                <tr>
                    <th>排序</th>
                    <th>ID</th>
                    <th>名字</th>
                    <th>图标</th>
                    <th>操作</th>
                </tr>
                </thead>
                <tbody>
                @foreach($info as $k=>$v)
                    <tr>
                        <td><input type="button" value="{{$v->id}}" style="color:black "></td>
                        <td>{{$v->id}}</td>
                        <td>{{$v->name}}</td>
                        <td><img src="{{url('admin')}}/images/a.jpg"></td>
                        <td>
                            <a href="{{url('zbfl_edit')}}?id=<?php echo $v->id; ?>">编辑</a>|
                            <a href="{{url('zbfl_del')}}?id=<?php echo $v->id; ?>">删除</a>
                        </td>
                    </tr>
                @endforeach
                </tbody>
            </table>
            </div>
            <div id="d2">
                <form class="layui-form"  action="{{url('zbfl_addlist')}}" method="post" enctype="multipart/form-data">
                    {{csrf_field()}}
                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>序号
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="level-name" name="level-name" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>
                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>名称
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="level-name" name="name" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="level-name" class="layui-form-label">
                            <span class="x-red">*</span>图片
                        </label>
                        <div class="layui-input-inline">
                            <input type="file" id="level-name" name="face" required="" lay-verify="required"
                                   autocomplete="off"  class="layui-input">
                        </div>
                    </div>

                    <div class="layui-form-item">
                        <label for="level-kiss" class="layui-form-label">
                            <span class="x-red">*</span>描述
                        </label>
                        <div class="layui-input-inline">
                            <input type="text" id="level-kiss" name="level-kiss" required=""  lay-verify="required"
                                   autocomplete="off" class="layui-input">
                        </div>
                    </div>

                    <span class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="save" lay-submit="">
                    列表
                </button>


                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="save" lay-submit="">
                    添加
                </button>
        </span>



                </form>
            </div>
            <!-- 右侧内容框架，更改从这里结束 -->
        </div>

    </div>
@endsection
<style>
    #d2{
        display: none;
    }
</style>
<script src="{{asset('js')}}/app.js"></script>
<script>
    $(document).on("click","#span2",function(){
        if($("#d2").css("display")=="none"){
            $("#d2").css("display","block");
            $("#d1").css("display","none");
        }else{
            $("#d2").css("display","none");
            $("#d1").css("display","block");
        }
    })
    $(document).on("click","#span1",function(){
        if($("#d1").css("display")=="none"){
            $("#d1").css("display","block");
            $("#d2").css("display","none");
        }else{
            $("#d1").css("display","none");
            $("#d2").css("display","block");
        }
    })
</script>